local que_guoshi = fk.CreateSkill {
  name = "que_guoshi",
  tags = { Skill.Compulsory },
}
Fk:loadTranslationTable {
  ["que_guoshi"] = "国士",
  [":que_guoshi"] = "锁定技，当与你势力相同角色使用一张未被记录点数的非装备牌后，将此牌置于你武将牌上，称为“国士”并令已记录的点数相加；若你拥有至少7个“国士”，你变更为任意势力。",

  ["@fuji_guo"] = "点数",
  ["fuji_guoshi"] = "国士",

  ["$que_guoshi1"] = " ",
  ["$que_guoshi2"] = " ",
}
que_guoshi:addEffect(fk.CardUseFinished, {
  anim_type = "offensive",
  can_trigger = function(self, event, target, player, data)
    if player:hasSkill(que_guoshi.name) and target.kingdom == player.kingdom and
        data.card and not (data.card:isVirtual() or data.card.type == Card.TypeEquip or data.card.name ~= Fk:getCardById(data.card.id, true).name) and #data.card.subcards == 0 and
        not table.find(player:getPile("fuji_guoshi"), function(c)
          return data.card.number == Fk:getCardById(c, true).number
        end) then
      return true
    end
  end,
  on_use = function(self, event, target, player, data)
    local room = player.room
    local card = data.card
    player:addToPile("fuji_guoshi", data.card, true, self.name)
    room:addPlayerMark(player, "@fuji_guo", data.card.number)
    -- local cards = room:getCardsFromPileByRule(".|" .. data.card.number, 1, "allPiles")
    -- if #cards > 0 then
    --   room:moveCards({
    --     ids = cards,
    --     to = player.id,
    --     toArea = Card.PlayerHand,
    --     moveReason = fk.ReasonPrey,
    --     proposer = player.id,
    --     skillName = self.name,
    --   })
    -- end
    if #player:getPile("fuji_guoshi") == 7 then
      local kingdoms = table.simpleClone(Fk.kingdoms) --获取游戏内的所有势力
      local choice = room:askToChoice(player, {
        choices = kingdoms,
        skill_name = "que_guoshi",
        all_choices = Fk.kingdoms,
      })
      room:changeKingdom(player, choice, true)
    end
  end,
})

return que_guoshi
